class Solution(object):
    def findSubsequences(self, nums):
        """
        :type nums: List[int]
        :rtype: List[List[int]]
        """
        res = set()
        path = []

        def backtrack(start):
            if len(path) >= 2:
                res.add(tuple(path))
            used = set()
            for i in range(start, len(nums)):
                if (not path or nums[i] >= path[-1]) and nums[i] not in used:
                    used.add(nums[i])
                    path.append(nums[i])
                    backtrack(i + 1)
                    path.pop()

        backtrack(0)
        return [list(seq) for seq in res]

if __name__ == "__main__":
    nums = [4, 6, 7, 7]
    solution = Solution()
    result = solution.findSubsequences(nums)
    print("递增子序列结果:")
    for seq in result:
        print(seq)
